package com.itheima.xiancheng.demo2;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie extends Thread{
    ArrayBlockingQueue abq;

    public Foodie(ArrayBlockingQueue<String> abq) {
        this.abq=abq;
    }

    @Override
    public void run() {
        int count=0;
        while(count<10) {
            try {
                abq.take();
                count++;
                System.out.println("吃货吃了"+count);


            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
